<style type="text/css">
<!--
#ad_table { background-color:#D8D8D8; }
#ad_table th { background-color:#EEEEEE; text-align:center; }
#ad_table th, #ad_table td { padding:5px 10px; font-size:12px; line-height:normal; word-wrap:break-word; word-break:break-all; }
#ad_table td { background-color:#FFFFFF; text-align:center; font-size:14px; }
.s_noset_bg { background:#CCC; }
-->
</style>
<?php

/*
$sbar = @glob('readonly/js/search_bar_*.js');
$sbar_n = @count($sbar);
*/

$sbar_n = 3;

$s_b = (!empty($_COOKIE['searchBarBody']) && $_COOKIE['searchBarBody'] != 0 && abs($_COOKIE['searchBarBody']) <= $sbar_n) ? abs($_COOKIE['searchBarBody']) : $web['search_bar'];
?>
<table width="100%" border="0" cellspacing="1" cellpadding="0" id="ad_table">
  <tr>

    <th colspan="<?php echo $sbar_n; ?>" scope="col" style="text-align:left;">我的引擎模式</th>
  </tr>
  
<?php
if ($sbar_n > 0) {
  echo '<tr>';
  for ($i = 1; $i<=$sbar_n; $i++) {
echo '
    <td width="33%">样式'.$i.' [<a href="search_bar.php?type='.$i.'" target="_blank">预览</a>]</td>
';
  }
  echo '</tr>';
  echo '<tr>';
  for ($i = 1; $i<=$sbar_n; $i++) {



echo '
    <td width="33%"><button type="button" onclick="setS('.$i.');" id="yes'.$i.'"'.($s_b == $i ? '>√' : ' class="s_noset_bg">').'选择该样式</button></td>
';
  }
  echo '</tr>';
} else {
  echo '<tr><td>没有发现搜索引擎样式模板！</td></tr>';
}
?>
</table>
<script language="javascript" type="text/javascript">
<!--
var dfSet=<?php echo $s_b; ?>;
function setS(v) {
  if ($('yes'+v+'').innerHTML == '√选择该样式') {
    alert('已是当前设置！');
    return;
  }
  setCookie('searchBarBody', v, 365);
  $('yes'+dfSet+'').innerHTML = '选择该样式';
  $('yes'+dfSet+'').className = 's_noset_bg';
  $('yes'+v+'').innerHTML = '√选择该样式';
  $('yes'+v+'').className = '';
  dfSet = v;
  alert('设置好了！再次使用将显示此样式');
}
-->
</script>
<br />

<table width="100%" border="0" cellspacing="1" cellpadding="0" id="ad_table">
  <tr>

    <th colspan="<?php echo $sbar_n; ?>" scope="col" style="text-align:left;">搜索下拉框内容智能联想</th>
  </tr>
  <tr>
    <td><label for="zn_0"><input type="radio" class="radio" name="zn" id="zn_0" onclick="setZ(0)"<?php echo (!isset($_COOKIE['searchLenovo']) || $_COOKIE['searchLenovo'] != 1) ? '  checked="checked"' : ''; ?> /> 开启</label> &nbsp;&nbsp;&nbsp;&nbsp; <label for="zn_1"><input type="radio" class="radio" name="zn" id="zn_1" onclick="setZ(1)"<?php echo (isset($_COOKIE['searchLenovo']) && $_COOKIE['searchLenovo'] == 1) ? ' checked="checked"' : ''; ?> /> 关闭</label></td>
  </tr>
</table>

<script language="javascript" type="text/javascript">
<!--
function setZ(v) {
  if(v == 1) {
    var s='关闭了';
    setCookie('searchLenovo', v, 365);
  }else{
    var s='开启';
    setCookie('searchLenovo', '', -365);
  }
  alert('设置完毕！智能下拉框联想功能'+s+'');
}



-->
</script>














